<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let obj = {
            name:'闰土',
            msg:'打死都用var,一用就办公室聊天'
        }
        function foo(obj){//形参  变量名
            // console.log(obj);
            let {name,msg} = obj;
            console.log(name,msg);
        }
        foo(obj);//实参

        // 需求，我想在函数调用时，直接打印出name  msg的值

        function fun({name,msg}){
            console.log(name,msg);
        }
        fun(obj);

        

    </script>
</body>
</html>